// import { InfoModel } from '../../model/user/info.model';

/**
 * @apiDefine myInfoCtrl
 * @apiParam {String} test 用户名1111.
 */
export class ManageCtrl {
  public static async addUser(ctx: any) {
    let { username, password } = ctx.request.body;
    if (!username || !password) {
      let obj = {
        success: false,
        message: '用户名或密码不能为空'
      };
      ctx.assert(obj, 400, '用户名或密码不能为空');
    }
    if (username === 'admin') {
      let obj = {
        success: false,
        message: '该用户名已被使用'
      };
      ctx.assert(obj, 400, '该用户名已被使用');
    } else {
      console.log(password);
      ctx.body = {
        success: true,
        data: {
          username
        }
      };
    }
  }
  public static async deleteUser(ctx: any) {
    console.log(ctx);
  }
}
